package com.pearadmin.pro.modules.feedback.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.feedback.domain.ScrmStuFeedback;
import com.pearadmin.pro.modules.feedback.param.ScrmStuFeedbackRequest;
import com.pearadmin.pro.modules.feedback.repository.ScrmStuFeedbackRepository;
import com.pearadmin.pro.modules.feedback.service.ScrmStuFeedbackService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


/**
 * 学生意见反馈Service业务层处理
 *
 * @author chenJian
 * @date 2021-10-07
 */
@Service
public class ScrmStuFeedbackServiceImpl extends ServiceImpl<ScrmStuFeedbackRepository, ScrmStuFeedback> implements ScrmStuFeedbackService
{
    @Resource
    private ScrmStuFeedbackRepository scrmStuFeedbackRepository;

    /**
     * 查询学生意见反馈
     * @param request
     * @return 学生意见反馈 分页集合
     * */
    @Override
    public PageResponse<ScrmStuFeedback> page(ScrmStuFeedbackRequest request)
    {
        LambdaQueryWrapper<ScrmStuFeedback> query = new LambdaQueryWrapper<ScrmStuFeedback>();
        return Pageable.of(request,(()->  scrmStuFeedbackRepository.selectList(query)));
    }
    /**
     * 保存学生意见反馈
     *
     * @param id 学生意见反馈ID
     * @return 学生意见反馈
     */
    @Override
    public boolean saveOrUpdate(ScrmStuFeedback request) {
        return save(request);
    }

    /**
     * 查询学生意见反馈
     *
     * @param id 学生意见反馈ID
     * @return 学生意见反馈
     */
    @Override
    public ScrmStuFeedback selectScrmStuFeedbackById(Long id)
    {
        return scrmStuFeedbackRepository.selectById(id);
    }

}
